package net.sea.setup.config.custom;

import java.util.ArrayList;
import java.util.List;

/**
 * 用户自定义配置
 *
 * @author 华成伍
 *
 */
public class CustomConfig {
	// 配置类别
	private String type;
	// 配置信息
	private List<CustomConfigItem> items = new ArrayList<CustomConfigItem>();

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public List<CustomConfigItem> getItems() {
		return items;
	}

	public void addItem(CustomConfigItem item) {
		items.add(item);
	}

	@Override
	public String toString() {
		StringBuffer str = new StringBuffer();
		str.append(type + "\n ");
		if (items != null) {
			for (CustomConfigItem item : items) {
				if (item.isVisible()) {
					str.append("\t").append(item.toString());
				}
			}
		}
		return str.toString();
	}
}
